﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace sync_web
{
    public class ConnectionUtil
    {
        //public static String GetConnectionString2()
        //{
        //    return @"Data Source=.\SQLEXPRESS;Initial Catalog=BackOffice;User Id=as;Password=as";
        //}

        public static String GetConnectionString()
        {
            // Chanan
            return "";// "Data Source=vm-sql01; Initial Catalog=BackOffice_prod; User Id=Backoffice-adm-prod; Password=bo235%adm-prod";
            try
            {
                if (System.Configuration.ConfigurationManager.ConnectionStrings != null)
                {
                    if (System.Configuration.ConfigurationManager.ConnectionStrings["BackOffice"] != null)
                    {
                        return System.Configuration.ConfigurationManager.ConnectionStrings["BackOffice"].ConnectionString;
                    }
                }

                // return "Data Source=vm-sql01;Initial Catalog=BackOffice;User Id=Backoffice-adm;Password=bo235%adm1;Connect Timeout=500;";
                throw new ArgumentNullException("Connection string named \"BackOffice\" could not be read from configuration file.");


                // return "Data Source=vm-sql01;Initial Catalog=Backoffice_Utv;User Id=Backoffice-utv-adm;Password=bo235%adm1utv";
                // return "Data Source=c1.ceriq.se;Initial Catalog=RickTest;User Id=systeam;Password=sVef#hu8";
                /// return "Data Source=runner2.systeamportal.se;Initial Catalog=BackOffice;User Id=Backoffice;Password=jhus";
            }
            catch (NullReferenceException)
            {
                throw new ArgumentNullException("Connection string named \"BackOffice\" could not be read from configuration file.");
            }
        }
    }
}
